<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
  <?php include_stylesheets() ?>
  <?php include_javascripts() ?>
</head>
<body>
<script>
<!--
function editLogo()
{
    $('#logo').css('display', 'none');
    $('#uploadLogoForm').css('display', '');
}
function submitLogo()
{
    document.getElementById('uploadLogoForm').submit();
}
-->
</script>

<table class="editor" id="logo"<?php if (!$has_logo) echo ' style="display: none;"' ?>>
  <tr>
    <td>
      <img width="110" height="80" src="<?php echo url_for('@campaign_logo?job_id='.$job->job_id.'&mode=logo&uid='.uniqid()) ?>"/>
    </td>
    <td class="text-center">
      <?php if ($error && $has_logo) echo $error.'<br />';?>
      <a href="#" onClick="editLogo()"<?php if (!$has_logo) echo ' style="display: none;"' ?>><?php echo __('Modify') ?></a>
    </td>
  </tr>
</table>
<form id="uploadLogoForm" enctype="multipart/form-data" action="<?php echo url_for('@campaign_logo', true).'?job_id='.$job->job_id ?>" method="post"<?php if ($has_logo) echo ' style="display: none;"' ?> >
    <?php if ($error && !$has_logo) echo $error;?>
    <input type="file" id="file" name="file" class="inputtext" onchange="submitLogo()"/>
</form>
  </body>
</html>
